/**
 * 秒数转时间
 * @param {Number} second 时间差：秒
 * @returns format as "00:00"
 */
export const formatTime = (second)=>{
    let seconds = Math.round(second)
    let min = Math.floor(seconds / 60) >= 10 ? Math.floor(seconds / 60) : '0' + Math.floor(seconds / 60);
    seconds -= 60 * min;
    let sec = seconds >= 10 ? seconds : '0' + seconds;
    return  min + ':' + sec;
}

/**
 * 时间转秒数
 * @param time
 * @returns {number}
 */
export const timeToSec =  (time)=> {
    var s = '';
    var min = time.split(':')[0];
    var sec = time.split(':')[1];
    s = Number(min*60) + Number(sec);
    return s;
};